﻿using IntelligentGateway.SmartCommunity.Model;

namespace IntelligentGateway.SmartCommunity.DAL
{
    public class DeviceDAL
    {
        //public DevInfo QueryDev()
        //{
        //    string strSql = "SELECT * from devinfo limit 0,1";
        //    CommFN<DevInfo> fn = new CommFN<DevInfo>();
        //    return fn.GetData(strSql);
        //}

        //public bool UpdateDevInfo(DevInfo device)
        //{
        //    string strSql = string.Format("UPDATE devinfo SET liftid={0},serverIP='{1}',serverport={2},protocoltype='{3}',mainIP='{4}',mainPort={5},enable={6} WHERE ID={7}", device.liftid, device.serverIP, device.serverport, device.protocoltype, device.mainIP, device.mainPort, device.enable, device.ID);
        //    CommFN<DevInfo> fn = new CommFN<DevInfo>();
        //    return fn.ExecFN(strSql);
        //}

        //public bool UpdateSwithInfo(DevInfo device)
        //{
        //    string strSql = string.Format("UPDATE devinfo SET printlog={0},ttrAMA3_send={1},ttrAMA3_receive={2},ttrAMA1_receive={3},ttrAMA2_receive={4} WHERE ID={5}", device.printlog, device.ttrAMA3_send, device.ttrAMA3_receive, device.ttrAMA1_receive, device.ttrAMA2_receive, device.ID);
        //    CommFN<DevInfo> fn = new CommFN<DevInfo>();
        //    return fn.ExecFN(strSql);
        //}

        //public bool InsertDevInfo(DevInfo device)
        //{
        //    string strSql = string.Format("INSERT INTO devinfo (liftid,serverIP,serverport,protocoltype,mainIP,mainPort,enable)VALUES({0},'{1}',{2},'{3}','{4}',{5},{6})", device.liftid, device.serverIP, device.serverport, device.protocoltype, device.mainIP, device.mainPort, device.enable);
        //    CommFN<DevInfo> fn = new CommFN<DevInfo>();
        //    return fn.ExecFN(strSql);
        //}

        //public List<AuthMode> QueryAuthMode()
        //{
        //    string strSql = "SELECT * from workmode";
        //    CommFN<AuthMode> fn = new CommFN<AuthMode>();
        //    return fn.GetDataList(strSql);
        //}

        //public bool UpdateAuthMode(DevInfo device)
        //{
        //    try
        //    {
        //        string strSql = string.Format("UPDATE devinfo SET authmode={0} WHERE ID={1}", device.authmode, device.ID);
        //        CommFN<Equipment> fn = new CommFN<Equipment>();
        //        return fn.ExecFN(strSql);
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}
    }
}
